package com.joyintech.enums;

/**
 * 理财风险等级转换   理财的风险等级是反者来的
 */
public enum FcRiskLevelEnum {

    R1("05","低风险级别（1级"),
    R2("04","较低风险级别（2级）"),
    R3("03","中等风险级别（3级）"),
    R4("02","较高风险级别（4级）"),
    R5("01","极高风险级别（5级）"),
    ;

    private String code;
    private String name;

    FcRiskLevelEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static FcRiskLevelEnum getNameByCode(String code) {
        for (FcRiskLevelEnum codeEnum : FcRiskLevelEnum.values()) {
            if (codeEnum.getCode().equals(code)) {
                return codeEnum;
            }
        }
        return null;
    }
}
